<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://www.webapp.com.vn/tags" prefix="web" %>
<html>
<head>

<style type="text/css">
	.ui-selecting {
		background: silver;
	}
	.ui-selected {
		background: gray;
	}
</style>
</head>
<body>
	<div>
		<h2>Search Cash Flow</h2>
		<s:form id="frmCashflow" method="post" validate="false" theme="simple">
			<s:hidden name="orderColumn" id="orderColumn"/>
			<s:hidden name="pagingInfo.indexPage" id="pagingInfo.indexPage" value="1"/>
			<s:hidden name="pagingInfo.offset" id="pagingInfo.offset" value="10"/>
			
			<table>	
				<tr>
					<td><label>Settle Date</label> </td>
					<td><input type="text" name="cashflowCondition.settleDateFrom" id="frmCashflow_settleDateFrom"
							value="${cashflowCondition.settleDateFrom}"/>
						<input type="text" name="cashflowCondition.settleDateTo" id="frmCashflow_settleDateTo"
							value="${cashflowCondition.settleDateTo}"/>
					</td>
				</tr>
				<tr>
					<td><label>Cash Type</label> </td>
					<td>
						<select name="cashflowCondition.propertyKey">
							<option selected="selected" value="">All</option>
							<option value="CUS">Transfer</option>
							<option value="DEP">Deposit</option>
							<option value="WID">Withdraw</option>
							<option value="BET">Bet</option>
						</select>
					</td>
				</tr>
				<tr>
					<td><label>Cashflow Id</label> </td>
					<td><input type="text" name="cashflowCondition.cashflowId" 
							value="${cashflowCondition.cashflowId}"/></td>
				</tr>
				<tr>
					<td><label>Customer Id</label> </td>	
					<td>
						<input type="text" name="cashflowCondition.customerId" 
							value="${cashflowCondition.customerId}"/>
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<s:submit />		
						<web:showPaging usingURLForNav="false" navAction="_goTo" pagingInfo="${pagingInfo}" formId="frmCashflow"/>
					</td>
				</tr>
			</table>		
		</s:form>

		<h1>Cash Flow</h1>
			
      	<table border="1px" cellpadding="8px">
		    <tr>
		      <th width="13">Id</th>
		      <th width="87">Issue Date</th>
		      <th width="87">Settle Date</th>
		      <th width="87">Customer Id</th>
		      <th width="351">Description</th>
		      <th width="86">Amount ($)</th>
		      <th width="92">Balance ($)</th>
		    </tr>
		    <s:iterator value="cashflowList" var="cashflow">
			      <tr>
				        <td><s:property value="cashflowId"/></td>
				        <td><s:date name="issueDate" format="%{getText('datetime.format')}"/></td>
				        <td><s:date name="settleDate" format="%{getText('datetime.format')}"/></td>
					    <td><s:property value="customerId"/></td>
					    <td><s:text name="%{description}"/></td>
					    <td><s:property value="amount"/></td>
					    <td><s:property value="balance"/></td>
				   </tr>
		    </s:iterator>
	  	</table>
	</div>	

</body>
</html>